package com.lry;

import lombok.Data;

import java.util.UUID;

@Data
public class BranchSession {

    private String xid;

    private String branchId;

    private BranchStatus status;
    private Rm rm;

    public BranchSession(){}

    private BranchSession(String xid, BranchStatus status,Rm rm) {
        this.xid = xid;
        this.status = status;
        this.branchId = UUID.randomUUID().toString();
        this.rm = rm;
    }

    public static BranchSession createBranchSession(String xid, BranchStatus branchStatus,Rm rm){
        return new BranchSession(xid,branchStatus,rm);
    }

}
